package com.mep.auth.controller;

import com.mep.auth.feign.IFeignSysLoginLogApi;
import com.mep.auth.model.SysLoginLog;
import com.mep.auth.service.SysLoginLogService;
import com.mep.common.http.HttpResult;
import com.mep.common.page.PageRequest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiOperationSupport;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * 登录日志控制器
 * @author lyl
 * @date Jan 13, 2019
 */
@Api(value="004-loginlog的controller",tags="004-loginlog的controller")
@RestController
@RequestMapping("loginlog")
public class SysLoginLogController implements IFeignSysLoginLogApi {

	@Autowired
	private SysLoginLogService sysLoginLogService;

	@Override
	@ApiOperation(value="01.loginlog分页数据",notes="问题点:loginlog分页数据")
	@ApiOperationSupport(order = 1, author = "lyl")
	//@PostMapping(value="/findPage")
	public HttpResult findPage(@RequestBody PageRequest pageRequest) {
		return HttpResult.ok(sysLoginLogService.findPage(pageRequest));
	}

	@Override
	@ApiOperation(value="02.删除loginlog",notes="问题点:删除loginlog")
	@ApiOperationSupport(order = 2, author = "lyl")
	//@PostMapping(value="/delete")
	public HttpResult delete(@RequestBody List<SysLoginLog> records) {
		return HttpResult.ok(sysLoginLogService.delete(records));
	}
}
